package Atm;
import java.util.Scanner;

public class Person extends pass{
    public void method() {
        Scanner scanner = new Scanner(System.in);
        pass pa = new pass();
        for (int i = 0; i < 3; i++) {
            System.out.println("请输入你的密码:");
            int num = scanner.nextInt();
            if (num == pa.getPassword()) {
                int n = 1;
                do {
                    System.out.println("1.取钱" + "\n" + "2.存钱" + "\n" + "3.查看余额" + "\n" + "4.退卡");
                    System.out.println("请选择你要的服务：");
                    int num1 = scanner.nextInt();
                    Cq cq = new Cq();
                    switch (num1) {
                        case 1:
                            System.out.println("请输入你要取的金额：");
                            cq.setMoney(scanner.nextInt());
                            cq.Cq1();
                            System.out.println("请输入0返回：");
                            n = scanner.nextInt();
                            break;
                        case 2:
                            System.out.println("请输入你要存的金额：");
                            cq.setMoney(scanner.nextInt());
                            cq.Qq();
                            System.out.println("请输入0返回：");
                            n = scanner.nextInt();
                            break;
                        case 3:
                            cq.Ckye();
                            System.out.println("请输入0返回：");
                            n = scanner.nextInt();
                            break;
                        case 4:
                            n = 2;
                            break;
                        default:
                            System.out.println("你输入的有误");
                            break;
                    }
                } while (n == 0);
                break;

            } else {
                System.out.println("你输入的密码有误！！");
            }
        }
    }
    @Override
    public void fun() {
        System.out.println("请插入你的银行卡");
    }
}